A categorical programming language
نویسنده
چکیده
A theory of data types and a programming language based on category theory are presented. Data types play a crucial role in programming. They enable us to write programs easily and elegantly. Various programming languages have been developed, each of which may use different kinds of data types. Therefore, it becomes important to organize data types systematically so that we can understand the relationship between one data type and another and investigate future directions which lead us to discover exciting new data types. There have been several approaches to systematically organize data types: algebraic specification methods using algebras, domain theory using complete partially ordered sets and type theory using the connection between logics and data types. Here, we use category theory. Category theory has proved to be remarkably good at revealing the nature of mathematical objects, and we use it to understand the true nature of data types in programming. We organize data types under a new categorical notion of F,G-dialgebras which is an extension of the notion of adjunctions as well as that of T -algebras. T -algebras are also used in domain theory, but while domain theory needs some primitive data types, like products, to start with, we do not need any. Products, coproducts and exponentiations (i.e. function spaces) are defined exactly like in category theory using adjunctions. F,G-dialgebras also enable us to define the natural number object, the object for finite lists and other familiar data types in programming. Furthermore, their symmetry allows us to have the dual of the natural number object and the object for infinite lists (or lazy lists). We also introduce a functional programming language in a categorical style. It has no primitive data types nor primitive control structures. Data types are declared using F,G-dialgebras and each data type is associated with its own control structure. For example, natural numbers are associated with primitive recursion. We define the meaning of the language operationally by giving a set of reduction rules. We also prove that any computation in this programming language terminates using Tait’s computability method. A specification language to describe categories is also included. It is used to give a formal semantics to F,G-dialgebras as well as to give a basis to the categorical programming language we introduce.
منابع مشابه
Categorical Semantics for a Quantum Language∗
We prove a correspondence theorem for a quantum programming language in an axiomatic (categorical) setting. We present a simple whilebased programming language for a machine that has access to Quantum Systems (in particular a system of qubits) and the relevant operations on them. We give (coinciding) operational and denotational semantics for this language at a concrete level (Hilbert spaces an...
متن کاملCategorical Semantics of Reference Data Type
Reference types are very useful structures enabling handling with dynamic memory. In this paper we extend categorical model of type system with reference data type. We illustrate our approach on simple functional programming language T-NBL extended with reference type. After constructing parametric algebraic specification we construct categorical model of reference type and we show how our resu...
متن کاملA DCPO-enriched linear/non-linear model
Rios and Selinger have recently proposed a categorical model for the quantum programming language Proto-Quipper-M, which is an important fragment of the Quipper language. In this work, we describe an extension to their categorical model with the additional property that it is DCPOenriched, bringing us closer to modeling general recursion in the language. Similar to their model, our model exhibi...
متن کاملCategorical Description of Dynamic Fuzzy Logic Programming Language
First, this paper gives the relative basic theory of dynamic fuzzy logic, and introduces the basic data types of dynamic fuzzy logic. Then we introduce the basic data types of dynamic fuzzy logic and the abstract syntax of dynamic fuzzy logic programming language. At last, this paper gives the categorical description of dynamic fuzzy logic programming language according to categorical theory, a...
متن کاملCompiler Veriication in Lf
We sketch a methodology for the veriication of compiler correctness based on the LF Logical Framework as realized within the Elf programming language. We have applied this technique to specify, implement, and verify a compiler from a simple functional programming language to a variant of the Categorical Abstract Machine (CAM).
متن کاملA categorical foundation for structured reversible flowchart languages
Structured reversible flowchart languages is a class of imperative reversible programming languages allowing for a simple diagrammatic representation of control flow built from a limited set of control flow structures, as ordinary structured flowcharts allow for conventional languages. This class includes the reversible programming language Janus (without recursion), as well as more recently de...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1987